Skip to content

Split mxenv into pip and uv environment variants#73

Draft
jensens wants to merge 17 commits into
mainfrom
feature/mxenv-variant-split
Draft

Split mxenv into pip and uv environment variants#73
jensens wants to merge 17 commits into
mainfrom
feature/mxenv-variant-split

Conversation

@jensens
Copy link
Copy Markdown
Member

@jensens jensens commented May 30, 2026

Summary

Replaces the single, heavily-branched core.mxenv domain with a shared base plus two thin environment variants, and routes dev-tool execution behind variant-provided macros so QA tool files stay world-agnostic. Supersedes #67 (the TOOL_RUNNER toggle); this approach is simpler and keeps pip as a deliberate fallback.

Two orthogonal concerns are now cleanly separated:

  • Environment provisioning (pip vs uv) → the variant split.
  • Dev-tool execution (venv-install vs uvx) → variant-defined macros (INSTALL_TOOL/RUN_TOOL/UNINSTALL_TOOL).

This is a major release (3.0.0) with a breaking change to mxenv configuration; see docs/source/migration.md.

What changed

  • core.mxenv is now an abstract base; new core.mxenv-pip and core.mxenv-uv variants provide provisioning + macros. Every other domain keeps depends = core.mxenv unchanged.
  • Exactly one variant is enforced; the selected variant is emitted immediately after the base so its parse-time PYTHON_PACKAGE_INSTALLER definition is visible to downstream domains (packages.mk etc.).
  • mxmake update reads the previous PYTHON_PACKAGE_INSTALLER value to pick the matching variant on migration (pip users stay on pip; default is uv).
  • Style/format tools (ruff, isort, black, zpretty, pyupgrade) run via uvx by default under the uv variant. Type-checkers (mypy, ty, pyrefly) always install into the environment.
  • uv variant supports UV_PROVISION=pip|sync and TOOL_EXECUTION=uvx|venv.
  • Removed: PYTHON_PACKAGE_INSTALLER/UV_PYTHON settings on the base; local-uv-into-venv fallback; "uv outdated" warning.
  • Also fixed pre-existing ty diagnostics (generic template decorator, a None guard, modern test loader) so typecheck is clean.
  • Docs: CHANGES, migration guide, getting-started, preseeds updated. mxmake's own Makefile regenerated onto the uv variant.

Design spec and implementation plan are under docs/superpowers/.

Test plan

  • pytest full suite — 39 passed
  • Functional: pip + uv variants generate correctly; variant ordered before packages; swap-variant + update flips the world; legacy pip Makefile stays pip on update
  • Self-hosted: make install (uv variant), make test, make check (ruff via uvx + ty) all pass
  • make typecheck (ty) — clean (pre-existing diagnostics fixed in this branch)

@jensens jensens mentioned this pull request May 30, 2026
jensens added 2 commits May 30, 2026 15:24
Test each variant against a properly generated Makefile (uv variant needs
global uv; pip variant via mxmake update) instead of overriding
PYTHON_PACKAGE_INSTALLER on a variant-locked Makefile. Drop obsolete
uv-local-install scenarios; rely on test.yml for Windows coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant